<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*,app.stock.common.*,app.stock.web.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Transaction.label%></title>
<%@ include file="head.jsp"%>
<%@ include file="js.jsp"%>
<script type="text/javascript">
	$(function() {
	   $( "#<%=Transaction.dateName%>" ).datepicker({	        	
		    showWeek: true,
	        firstDay: 1,
	        dateFormat: 'yy-mm-dd 00:00:00'
	    });
    });
</script>
</head>
<body>
<%@ include file="bodyhead.jsp"%>
<form name="add_form" method="post" onsubmit="submitForm('add_form',['page=transaction_add.jsp','action=add'])" action="">
<table>
	<tbody>
		<tr>
			<td><label><%=Transaction.dateLabel%></label></td>
			<td><input id="<%=Transaction.dateName%>" name="<%=Transaction.dateName%>"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.typeLabel%></label></td>
			<td><select name="<%=Transaction.typeName%>">
				<%
					for (int i = 0; i < TransactionTypes.values.length; i++) {
				%>
				<option value="<%=TransactionTypes.values[i]%>"><%=TransactionTypes.values[i]%></option>
				<%
					}
				%>
			</select></td>
		</tr>
		<tr>
			<td><label><%=Transaction.codeLabel%></label></td>
			<td><input name="<%=Transaction.codeName%>" onchange="setStockName()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.nameLabel%></label></td>
			<td><input name="<%=Transaction.nameName%>"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.priceLabel%></label></td>
			<td><input name="<%=Transaction.priceName%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.amountLabel%></label></td>
			<td><input name="<%=Transaction.amountName%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.sum1Label%></label></td>
			<td><input name="<%=Transaction.sum1Name%>"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.shouxufeiLabel%></label></td>
			<td><input name="<%=Transaction.shouxufeiName%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.yinhuashuiLabel%></label></td>
			<td><input name="<%=Transaction.yinhuashuiName%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.guohufeiLabel%></label></td>
			<td><input name="<%=Transaction.guohufeiName%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.sum2Label%></label></td>
			<td><input name="<%=Transaction.sum2Name%>" readonly="readonly"></input></td>
		</tr>
	</tbody>
</table>
<input name="submit" type="submit" value="<%=Constants.label_operationSave%>" onclick="javascript:return checkForm()"></input>
<input name="reset" type="reset" value="<%=Constants.label_operationReset%>"></input>
</form>
</body>
</html>